﻿#include "AF_PublicFace.h"

namespace AF
{
	AF_CLink<PublicFace*> PublicFace::m_lnkPubFaces;

	void PublicFace::AddToScene(AF_CScene* pScene)
	{
#ifndef AF_HIDE_PUBLIC_FACE
		FOREACH(PublicFace*, _ppPF, m_lnkPubFaces)
		{
			if((*_ppPF)->GetEnable() == true)
				pScene->AddToCanvas(*_ppPF);
		}
#endif
	} 

	PublicFace::PublicFace() :
		ATTRIB(Enable)(false)
	{
		m_lnkPubFaces.Add(this);
	}

	PublicFace::~PublicFace()
	{
		m_lnkPubFaces.Remove(this);
	}
}